const { defineConfig } = require("@vue/cli-service");
const { name } = require("./package");

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port: 8882,
    headers: {
      "Access-Control-Allow-Origin": "*",
    },
  },
  configureWebpack: {
    output: {
      library: `${name}-[name]`,
      libraryTarget: "umd", // 把微应用打包成 umd 库格式
      chunkLoadingGlobal: `webpackJsonp_${name}`,
    },
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          // If you are using less-loader@5 please spread the lessOptions to options directly
          modifyVars: {
            // 这里就是样式变量的名称以及对应的值，可以按照上面提供的官方文档进行配置
            "primary-color": "#41B883",
            "link-color": "#41B883",
            "border-radius-base": "2px",
            "ant-prefix": "antmain",
          },
          javascriptEnabled: true,
        },
      },
    },
  },
});
